﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Lb.BackDbFrm
{
    public partial class SetMessageToDbFile : Form
    {

        public DbaseFrm.SetTextCallBack BackDataBase;

        public SetMessageToDbFile()
        {
            InitializeComponent();
        }



        private void txtMsg_KeyDown(object sender, KeyEventArgs e)
        {

        }

        private void Submit()
        {
            string msg;
            msg = this.txtMsg.Text;
            if (this.BackDataBase(msg))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {

                this.DialogResult = DialogResult.Cancel;
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Submit();
        }
    }
}
